// VideoPlay.h: interface for the CVideoPlay class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_VIDEOPLAY_H__48368FC6_3230_4635_AA99_BF6611FF8129__INCLUDED_)
#define AFX_VIDEOPLAY_H__48368FC6_3230_4635_AA99_BF6611FF8129__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include"windows.h"
extern "C"
{
	#include <libavformat/avformat.h>
	#include <libswscale/swscale.h>
	#pragma comment(lib,"avformat.lib")
	#pragma comment(lib,"avcodec.lib")	
	#pragma comment(lib,"avutil.lib")
	#pragma comment(lib,"avdevice.lib")
	#pragma comment(lib,"avfilter.lib")
	#pragma comment(lib,"swscale.lib")
}
class CVideoPlay  
{
public:
	CVideoPlay();
	virtual ~CVideoPlay();

public:
	int GetImageWidth() { return m_iImageWidth ;}
    int GetImageHeight() { return m_iImageHeight ;}
	int	LoadFile(char * pFileName);
	bool GetNextFrame();
	bool GetRawData(BYTE pFrame[]);
	int SetType(int nIndex); 
private:
	// The dimensions we can plot in, allowing for the width of the ball
    int m_iAvailableHeight, m_iAvailableWidth;
	PixelFormat m_type;
	bool	m_bUpSideDown;
    int m_iImageHeight;     // The image height
    int m_iImageWidth;      // The image width
    int m_iBallSize;        // The diameter of the ball

	AVFormatContext *m_pFormatCtx;
	AVCodecContext *m_pCodecCtx;
	AVCodec *m_pCodec;
	AVFrame	*m_pFrame;
	AVFrame *m_pFrameRGB;

	SwsContext *m_ctx ;
	int		 m_nVideoStream;
	

};

#endif // !defined(AFX_VIDEOPLAY_H__48368FC6_3230_4635_AA99_BF6611FF8129__INCLUDED_)
